package com.football.springboot.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.football.springboot.entity.League;
import com.football.springboot.entity.Team;
import com.football.springboot.entity.TeamData;
import com.football.springboot.entity.TeamDataSingle;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


public interface ITeamDataService extends IService<TeamData> {
    //新增主场球队的赛季比赛数据（比赛数从0到1,第一次新增第一轮比赛数据，即创建这一行数据）
    TeamData addgamedata(TeamDataSingle teamDataSingle);

    //找到要更新的那行数据（球队赛季数据）
    TeamData getupdategamedata(Integer teamId,Integer leagueId,String homeAway);

    //新增球队的赛季比赛数据（比赛数从1到n,新增第二轮以上的比赛数据时）
    TeamData updategamedata(TeamData teamData,TeamDataSingle teamDataSingle);

    //修改球队的赛季比赛数据(当你修改已经添加的比赛数据时)
    TeamData updategamedataexist(TeamData teamData,TeamDataSingle teamDataSinglebefore,TeamDataSingle teamDataSingle);

    //查找全部球队赛季数据信息
    List<TeamData> getAllTeamData();

    //查找球队赛季数据的球队信息
    Team getteaminfo(Integer teamId);

    //查找球队赛季数据的联赛信息
    League getleagueinfo(Integer leagueId);

    //计算赛季积分榜单一些数据 净胜球、场均进球、场均积分
    void countleague(TeamData teamData);

    //将一个球队主客场赛季数据信息相加组成总的
    TeamData teamDataall(TeamData hometeamdata,TeamData awayteamdata);

    //累加一个球队所有数据之和
    TeamData teamDataallleague(List<TeamData> teamDataList,TeamData teamDataall);

    //将teamdata存入到teamdatamap中
    Map<String,Object> getteamdatamap(Map<String,Object> teamdatamap,TeamData teamData);

    //将teamattackdata存入到teamdatamap中
    Map<String,Object> getteamattackdatamap(Map<String,Object> teamdatamap,TeamData teamData);

    //将teampassdata存入到teamdatamap中
    Map<String,Object> getteampassdatamap(Map<String,Object> teamdatamap,TeamData teamData);

    //将teamdata的average存入到teamdatamap中
    Map<String,Object> getteamavedatamap(Map<String,Object> teamavedatamap,TeamData teamData);

    //将teamattackdata的average存入到teamdatamap中
    Map<String,Object> getteamaveattackdatamap(Map<String,Object> teamavedatamap,TeamData teamData);

    //将teampassdata的average存入到teamdatamap中
    Map<String,Object> getteamavepassdatamap(Map<String,Object> teamavedatamap,TeamData teamData);
}
